<!--{include admin/top.html}-->
	<div class="mainPage">
		<style>
			.checkbox{
				width:100px;
				float:left;
				margin-left:10px;
				text-align:center;
				padding:3px;
				font-size:12px;
				color:blue;
			}
			.checked{
				background:#999;
			}
		</style>
		<!--{if $do == 'check'}-->
		<script>
			function addTags(obj){
				var str = $("#tags").text().Trim();
				var loc = parseInt(str.InStr($(obj).text()));
				if(loc > -1){
					var reg  = "/,?"+$(obj).text()+"/ig";
					str = str.replace(eval(reg),"");
					if(str.substring(0,1)==","){
						str = str.substring(1,str.length);
					}
					$(obj).removeClass("checked");
				}else{
					if(str.length == 0){
						str = $(obj).text().Trim();
					}else{
						str += ","+$(obj).text();
					}
					$(obj).addClass("checked");
				}
				$("#tags").text(str);
			}
			function finish(){
				window.returnValue = $("#tags").text();
				window.close();
			}
		</script>
		<h1 class="title">点击选择标签</h1>
		<div>
		{foreach $tags $k $v}
			<div class="checkbox">
				<a href="javascript:void(0)" onclick="addTags(this)"  style="padding:1px;color:#333">{$v['tag_name']}</a>
			</div>
		{/foreach}
		</div>
		<div style="clear:both"></div>
		<div style="margin-top:10px;">已选择:&nbsp;&nbsp;<span id="tags" style="color:gray"></span>
		<p style="line-height:30px;"> <a href="javascript:void(0)" onclick="finish()" style="color:red;font-size:14px;font-weight:bold">确定选择</a></p>
		<!--{else}-->
		<h1 class="title">标签列表</h1>
		<p><b>文章标签</b></p>
		{foreach $full_tags["art"] $k $v}
		<p>
			<a href="javascript:void(0)"  style="padding:1px;color:#333" >{$v['tag_name']}</a>
		</p>
		{/foreach}
		<p style="line-height:20px;margin-top:10px;"><b>产品标签</b></p>
		{foreach $full_tags["pro"] $k $v}
		<p>
			<a href="javascript:void(0)"  style="padding:1px;color:#333" >{$v['tag_name']}</a>
		</p>
		{/foreach}
		<div style="clear:both"></div>
		<!--{/if}-->
	</div>
</body>
</html>